#ifndef WORKLISTDIALOG_H
#define WORKLISTDIALOG_H

#include <QDialog>
class WListPatient;
class QCompleter;

namespace Ui {
class WorkListDialog;
}

class WorkListDialog : public QDialog
{
    Q_OBJECT

public:
    typedef enum {
        NewPatient,
        NewStudy,
        ChangeStudy,
    } EditMode;
    explicit WorkListDialog(WListPatient *const &_patient, EditMode _mode = NewPatient, QWidget *parent = 0);
    ~WorkListDialog();

protected slots:
    void onOk();
    void onClear();

    void patientSelected(const QString &name);
    void updateAge(const QDate &date, bool enforce = false);
    void updateBirth();

private:
    void init();
    Ui::WorkListDialog *ui;
    WListPatient *const &patient;
    QCompleter *completer;
    EditMode mode;
};

#endif // WORKLISTDIALOG_H
